package org.nf.users.service;

import org.nf.users.dao.UserDAO;
import org.nf.users.dao.impl.UserDaoImpl;
import org.nf.api.dto.PageDTO;
import org.nf.api.dto.UserDTO;
import org.nf.api.inf.UserService;

import java.util.List;

/**
 *  用户服务
 *
 * @author long
 * @date 2023/6/26
 */
public class UserServiceImpl implements UserService {

    UserDAO dao = new UserDaoImpl();

    /*1public User login(String username, String password) throws LoginException {
        UserDAO userDAO = new UserDaoImpl();
        User user = userDAO.select(username);

        if (StringUtils.isEmpty(username)||StringUtils.isEmpty(password)){
            throw new LoginException("账号或密码为空");
        }

        if (username.length()!=10){
            throw new LoginException("账号格式错误");
        }

        if (user == null) {
            throw new LoginException("此账号未注册");
        }

        if (!MD5Util.getSaltverifyMD5(password,user.getPassword())){
            throw new LoginException("账号或密码错误");
        }

        return user;
    }*/

    @Override
    public PageDTO<UserDTO> listUser(UserDTO userDTO, int pageNum, int pageSize) {
    return null;
    }

    @Override
    public void addUser(UserDTO user) {

    }

    @Override
    public UserDTO getUserById(int id) {
        return null;
    }

    @Override
    public UserDTO getUserByTel(String tel) {
        return null;
    }

    @Override
    public void updateUser(UserDTO user) {

    }

    @Override
    public void delUser(int id) {

    }

    @Override
    public void changePwd(UserDTO user, String oldPass, String newPass) {

    }

    @Override
    public List<UserDTO> queryUserByName(String userName) {
        return null;
    }

    @Override
    public void changeUserStatus(int userId, boolean userStatus) {

    }
}
